#define _CRT_SECURE_NO_WARNINGS 1

int cmp(const void* a, const void* b)
{
    return *(int*)a < *(int*)b;
}
int findContentChildren(int* g, int gSize, int* s, int sSize) {
    qsort(g, gSize, sizeof(int), cmp);
    qsort(s, sSize, sizeof(int), cmp);
    int count = 0;
    for (int i = 0; i < gSize; i++)
    {
        if (count == sSize)
            return sSize;
        if (g[i] <= s[count])
        {
            count++;
        }
    }
    return count;
}